package com.rem.cloudalibaba;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;


/**
 * 集成 feign 调用 生产者订单
 *
 * 启用feign @EnableFeignClients
 * https://github.com/spring-cloud/spring-cloud-openfeign
 *
 *
 *
 * @author Rem
 * @date 2021/7/12
 */
@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
public class ConsumerFeignOrder8002 {

    public static void main(String[] args) {
        SpringApplication.run(ConsumerFeignOrder8002.class, args);
    }

    @Bean
    @LoadBalanced
    public RestTemplate getRestTemplate() {
        return new RestTemplate();
    }
}
